<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Neo4j图谱</title>
    <script src="https://unpkg.com/neo4j-driver"></script>
    <script src="https://unpkg.com/neovis.js@1.6.0/dist/neovis.js"></script>
</head>
<body>
<h1>Neo4j图谱</h1>
<div id="viz" style="width: 100%; height: 600px;"></div>

<script>
    document.addEventListener('DOMContentLoaded', function() {
        // Neo4j连接信息
        var config = {
            container_id: 'viz',
            server_url: 'bolt://localhost:7687',
            server_user: 'neo4j',
            server_password: 'cwj10086',
            labels: {
                '公司': 'name',
                '地址': 'name',
                '职位': 'name',
                '要求': 'name',
                '工作': 'name',
                '技术栈': 'name',
            },
            relationships: {},
            initial_cypher: 'MATCH (n)-[r]->(m) RETURN n, r, m LIMIT 100',
            nodes: {
                // 使用节点属性作为节点标签
                caption: function(node) {
                    return node.properties.name;
                }
            }
        };

        var viz = new NeoVis.default(config);
        viz.render();
    });

</script>
</body>
</html>
